class H_BAG{E} < $BAG{E}
****
This Bag sorts its elements by counting the number of occurences. If two _different but equal_ elements are inserted only one of them will be stored, but this one will be yielded twice.
_


Flattened version is here

Ancestors
$BAG{_} $RO_BAG{_} $STR $CONTAINER{_}
$ELT{_} $ELT

Descendants
BAG{_}



Public


Features
copy: SAME
count(e:E): INT
**** Return the number of occurences of element "e"
create(e: $ELT{E}): SAME
create: SAME
create_from(a: ARRAY{E}): SAME
**** Create a bag from the elements of array "a".
delete(e:E)
delete(e:E): E
delete_all(e:E)
**** Delete all elements equal to "e"
delete_all(e:E): INT
difference(a:$RO_BAG{E}): $BAG{E}
**** Returns a bag which represents the difference between self and "a"
has(e:E): BOOL
insert(e:E)
intersection(a:$RO_BAG{E}): $BAG{E}
**** The intersection of two bag has the element with the minimal occurence of both bags.
n_unique: INT
**** Return the number of unique indicies

Iters
elt!: E


Private

internal_create: SAME
**** Redefine the stub routine in "BAG_INCL"
attr total_size: INT;
attr total_size: INT;

The Sather Home Page